package cn.terminus.service.customer.feign.dict;

import cn.terminus.result.common.result.TerminusResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 字典服务远程调用
 *
 * @author zy.yang
 */
@FeignClient(name = "terminus-dict")
public interface DictFeignClient {

    /**
     * 字典项查询
     *
     * @param param 字典code
     * @return 字典项
     */
    @RequestMapping(value = "/item/query", method = RequestMethod.POST)
    TerminusResult<List<ItemResult>> query(@RequestBody ItemQueryParam param);

    @PostMapping(value = "/item/queryAll")
    @ApiOperation(value = "字典项批量查询", httpMethod = "POST")
    TerminusResult<List<ItemListResult>> queryAll(@RequestBody ItemSearchParam param);
}
